<template>
	<view style="width: 100vw;height: 100vh;" class="flex_column main-con">

		<!-- 首页 -->
		<page-head></page-head>
		<view class="flex_row" style="justify-content: flex-end;">
			<image @click="navigateTo('/pages/logout/logout')" src="../../image/dbbtn/quit.png"
				class="img_px60 between_padding"></image>
            <image @click="navigateTo('/pages/manageLogin/manageLogin')" src="../../image/dbbtn/canshu.png"
            	class="img_px60 between_padding" style="margin-right: 40px;">
            </image>
		</view>
		<view style="height: 2vh;"></view>
		<view style="padding: 3vh 10vh;height: 46vh;" class="flex_row_between">
			<view class="flex_col_between" style="padding: 2vh 0px;">
				<view style="margin-top: 9vh;">
					<view class="rem04">
						<span>{{date}}</span><span style="margin-left: 24px;">{{week}}</span>
					</view>
					<view>
						<span class="rem15">{{time}}</span><span class="rem04"
							style="margin-left: 10px;">{{timeTip}}</span>
					</view>
				</view>
				<!-- <view class="flex_row alignCenter">
					<view class="flex_row alignCenter" style="padding-right:5vw;">
						<image style="width: 5vh;height: 5vh;" class="margin_top14"
							src="../../image/twylt1/homeIcon/wd.png">
						</image>
						<view class="flex_col margin_left10">
							<view>
								<span class="rem1">26</span><span class="fz16">°C</span>
							</view>
							<view class="rem04">舱内温度</view>
						</view>
					</view> -->
					<!-- <view
						style="background-image: linear-gradient(180deg, #1C2239 0%, #434C71 47%, #1C2239 100%);border-radius: 25.95px;height: 50px;width: 2px;">
					</view> -->
					<!-- <view class="flex_row alignCenter" style="padding-left:5vw;">
						<image style="width: 5vh;height: 5vh;" class="margin_top14"
							src="../../image/twylt1/homeIcon/sd.png">
						</image>
						<view class="flex_col margin_left10">
							<view>
								<span class="rem1">60</span><span class="fz16">%</span>
							</view>
							<view class="rem04">舱内湿度</view>
						</view>
					</view> -->
			<!-- 	</view> -->
			</view>
			<view style="height: 100%;width: 42vw;">
				<view style="position: relative;top: 0;left: 0;height: 100%;width: 100%;" class="allCenter">
					<view style="position: absolute;top: 0;left: 0;right: 0;bottom: 0">
						<image src="../../image/twylt1/homeIcon/border.png" style="width: 100%;height: 100%;">
						</image>
					</view>
					<button style="width: 20vw;height: 68px;background-color: #44CE7B;color: #1E2238;"
						hover-class="btnClick" class="border_r10 fz24  allCenter" @click="godjList">检测列表</button>
					<!-- <image src="../../image/twylt1/homeIcon/jiancelieb.png" style="width: 20vw;height: 68px;"
						hover-class="btnClick" class="border_r10 fz24  allCenter" @click="godjList"></image> -->
				</view>
			</view>
		</view>
		<view style="height: 11vh;"></view>
		<view style="padding:0 5vw ;" class="allCenter">
			<view v-if="type!=2" class="flex_row_between btm-con" :style="type?'width: 600px;':'width:100%'"
				@click="gognsz">
				<view v-if="!type" class="flex_column alignCenter">
					<image src="../../image/twylt1/homeIcon/kt.png" style="width: 6vh;height: 6vh;"></image>
					<view class="rem04 margin_top10">制冷</view>
				</view>
				<view v-if="!type" class="flex_column alignCenter">
					<image src="../../image/twylt1/homeIcon/ktszc.png" style="width: 6vh;height: 6vh;">
					</image>
					<view class="rem04 margin_top10">空调水</view>
				</view>
				<view class="flex_column alignCenter">
					<image src="../../image/twylt1/homeIcon/hq.png" style="width: 6vh;height: 6vh;"></image>
					<view class="rem04 margin_top10">通风</view>
				</view>
				<view class="flex_column alignCenter">
					<image src="../../image/twylt1/homeIcon/zm.png" style="width: 6vh;height: 6vh;"></image>
					<view class="rem04 margin_top10">照明</view>
				</view>
				<view v-if="!type" class="flex_column alignCenter">
					<image src="../../image/twylt1/homeIcon/cm.png" style="width: 6vh;height: 6vh;"></image>
					<view class="rem04 margin_top10">舱门</view>
				</view>
				<view class="flex_column alignCenter">
					<image src="../../image/twylt1/homeIcon/fr.png" style="width: 6vh;height: 6vh;"></image>
					<view class="rem04 margin_top10">辅热</view>
				</view>
				<view class="flex_column alignCenter">
					<image src="../../image/twylt1/homeIcon/xd.png" style="width: 6vh;height: 6vh;"></image>
					<view class="rem04 margin_top10">消毒</view>
				</view>
				<view v-if="!type" class="flex_column alignCenter">
					<image src="../../image/twylt1/homeIcon/ybdbf.png" style="width: 6vh;height: 6vh;">
					</image>
					<view class="rem04 margin_top10">迎宾灯</view>
				</view>
			</view>
			<view v-else style="height: 2.5rem;"></view>
		</view>

		<uni-popup ref="popup">
			<view style="padding:30rpx 60rpx;background-color: #fff;border-radius:10rpx;">
				<view class="alignCenter">
					<image src="../../image/icon/gw.png" style="width: 9vh;" mode="widthFix"></image>
					<view style="color: #000000;font-size:2vw;padding-left: 30rpx;">舱内温度过高，已经高于设置的最高值！</view>
				</view>
				<view style="justify-content: flex-end !important;display: flex;padding-top: 0.5rem;">
					<view style="width: 2rem;"></view>
					<view>
						<button>
							<view>今天不再提示</view>
						</button>
					</view>
					<view style="padding-left: 4vw;">
						<button>
							<view>1小时内不提示</view>
						</button>
					</view>
					<view style="padding-left: 4vw;">
						<button style="background: #44CE7B;">
							<view>我知道了</view>
						</button>
					</view>
				</view>
			</view>
		</uni-popup>
		<uni-popup ref="popup1">
			<view class="allCenter" style="background-color: #fff;border-radius: 0.2rem;padding: 0.3rem 0.8rem;">
				<image src="../../image/icon/yj.png" style="width: 9vh;" mode="widthFix"></image>
				<view style="color: #000000;font-size: 2vw;padding-left: 0.3rem;">舱内危险，请开门检查！</view>
			</view>

		</uni-popup>
	</view>
</template>

<script>
	console.log("版本号：0.1.5")
	export default {
		data() {
			return {
				type: 0,
				dayName: '',
				date: new Date().getFullYear() + '/' + (new Date().getMonth() + 1) + '/' + new Date().getDate(),
				time: new Date().getHours() + ':' + (new Date().getMinutes() < 10 ? '0' + new Date().getMinutes() :
					new Date().getMinutes()),
				week: '星期五',
				timeTip: '上午',
			}
		},

		created() {

			this.currentTime();
			new Date().getHours() > 12 ? this.timeTip = "下午" : ''
		},
		onShow: function() {
			// this.open()
			this.type = getApp().globalData.type;
			// console.log(getApp().globalData.type)
		},
		onReady() {
			// this.$refs.popup.open('center')
		},
		methods: {
			open() {
				this.$refs.popup.open('center')
			},
			close() {
				this.$refs.popup.close()
			},
			navigateTo(url) {
				uni.navigateTo({
					url: url
				})
			},
			godjList() {
				uni.navigateTo({
					url: '/pages/djList/djList'
				})
			},
			gognsz() {
				uni.navigateTo({
					url: '/pages/gnsz/gnsz'
				})
			},

			getTime() {
				var _this = this;
				let yy = new Date().getFullYear();
				let mm = new Date().getMonth() + 1;
				let dd = new Date().getDate();
				let hh = new Date().getHours();
				let mf = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes() : new Date().getMinutes();
				let ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds() : new Date().getSeconds();
				let wk = new Date().getDay()
				let weeks = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
				_this.week = weeks[wk]
				_this.date = yy + '/' + mm + '/' + dd;
				_this.time = hh + ':' + mf;
			},

			currentTime() {
				setInterval(this.getTime, 500)
			},
				
			hasOwnProperty(){
				let ss=new data
			}

		}
	}
</script>

<style scoped>
	page {
		/* background-image: url(../../image/twylt1/homeIcon/首页背景图.jpg); */
		/* background-image: url(../../image/home-bg.jpg); */
		/* background: #000000; */
		/* background-size: 100% 100%; */
		color: #FFF;
	}

	.main-con {
		background-image: url('../../image/home-bg.jpg');
		background-size: 100% 100%;
		color: #FFF;
	}

	.btnClick {
		background: #36BB6B !important;
	}

	.btm-con {
		padding: 2.5vh 8vh;
		background: rgba(74, 80, 121, 0.3);
		border-radius: 20px;
		margin-bottom: 0.5rem;
	}
</style>
